<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/admin.css'); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/main.css'); ?>">

<script language="JavaScript" src="<?php echo $this->_webroot('skin/js/jy.js'); ?>"></script>
<style>
td span {color:red;}
.green {color:green;}
.red {color:red;}
</style>
</head>
<body>
<input type="hidden" id="update_right" value="1" ></input>
<div id="maincontent">
<psp:tags     htmlname='messagebox'  iconname='messagebox' />
	<div class="wrap">
    <div class="crumbs">当前位置 &gt;&gt; 用户管理 &gt;&gt; 会员级别</div>
        <hr />
	<div class="infobox">
    <h3><span class="left">会员级别</span> <span style="margin-right:15px;" class="right"><a style="float:right;" href="<?php echo $this->_url('admin/userrank/add');?>">会员级别添加</a></span></h3>
    <div class="content2">
		<form action="<?php echo $this->_url('admin/userrank/delrank');?>" method="post">
		<table class="list_table">
		 <thead>
            <tr style="text-align:center;">
				<th width="20px" class="center"><input type="checkbox" value="" onclick="checkall(this,'rank_id[]');"></th>
				<th width="30px">ID</th>
				<th width="90px" align="left">会员级别</th>
				<th align="left">权限</th>
				<th width="90px" align="left">金额</th>				
				<th width="120px">操作</th>
			</tr>
		 </thead>
		 <tbody>
			<?php if($result) {
			foreach($result as $value) { $value = $value['userrank']; ?>
			<tr style="text-align:center;">
				<td><input type="checkbox" name="rank_id[]" <?php if($value['id'] < 5){echo "disabled value='' ";} else {echo ' value="'.$value['id'].'" ';} ?> /></td>
				<td><?php echo $value['id'];?></td>
				<td align="left">
				<div onclick="edit(this,<?php echo $value['id'];?>,'divlink<?php echo $value['id'];?>','a.php?act=updateAjax','tablename=user_rank&colname=rank_name&idname=rank_id&idvalue=<?php echo $value['id'];?>&logcontent=修改用户等级名称&colvalue=',20);"><?php echo $value['rank_name'];?></div>
				<div style="displya:none";></div>
				</td>
				<td align="left"><?php echo $value['pri'];?></td>
				<td align="center">￥<?php echo $value['money'];?>元</td>				
				<td class="center">
					<?php if ($value['id'] > 1){ ?>
						<a href="<?php echo $this->_url('admin/userrank/edit/'.$value['id']);?>">修改设置权限</a>
						<a href="<?php echo $this->_url('admin/userrank/delrank/');?>?id=<?php echo $value['id'];?>" onclick="return confirm('删除会员级别同时会将该级别下会员级别更改为企业普通级别，确定要删除吗？');">删除</a>
					<?php }?>
				</td>
			</tr>
			<?php }?>
			<tr>
				<td colspan="5"><span class="button-container"><input class="regular-button" type="submit" name=""  onclick="return delcheck();" value="批量删除" /></span></td>
			</tr>
			<?php } else { ?>
			<tr>
				<td colspan="7"></td>
			</tr>
			<?php } ?>
			<tr>
				<td colspan="7" class="center"></td>
			</tr>
		  </tbody>
		</table>
		</form>
		
		
	  </div>
	 </div>
	</div>
</div>
<script>
var inputs = document.getElementsByTagName("input");

function delcheck(){
	var checked = false; 
    for (var i = 0; i < inputs.length; i++) 
    { 
    	if (inputs[i].checked == true) 
        {
            checked = true;
            if(confirm('确定要执行此操作吗？')){
            	break; 
                }else{
                	return false;
                	break; 
                    }
        }
    } 
    if (!checked) 
    { 
        ShowMessageBox("请至少选择一个级别！",'0'); 
        return false; 
    }
    return true;
}
</script>
</body>
</html>